package com.easyj.admin.db.model;

import java.io.Serializable;
import java.util.Date;

import com.easyj.base.cache.SysCacheUtil;
import com.easyj.base.enums.Level2ApplyStatusEnum;

/**
 *   @title 社会任职
 *   @remark 
 *   @table s_social_job
 *   @primaryKey id
 *   @enablePage true
 */
public class SocialJob implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     *   @title 
     *   @remark 
     *   @column id
     *   @dataType BIGINT UNSIGNED
     *   @length 20
     *   @scale 0
     *   @nullable false
     *   @jdbcType BIGINT
     */
    private Long id;

    /**
     *   @title 任职名称
     *   @remark 
     *   @column name
     *   @dataType VARCHAR
     *   @length 250
     *   @scale 0
     *   @nullable false
     *   @jdbcType VARCHAR
     */
    private String name;

    /**
     *   @title 任职类型
     *   @remark 
     *   @column type
     *   @dataType VARCHAR
     *   @length 250
     *   @scale 0
     *   @nullable false
     *   @jdbcType VARCHAR
     */
    private String type;

    /**
     *   @title 任职机构/单位
     *   @remark 
     *   @column organizationt
     *   @dataType VARCHAR
     *   @length 250
     *   @scale 0
     *   @nullable false
     *   @jdbcType VARCHAR
     */
    private String organizationt;

    /**
     *   @title 任职地址
     *   @remark 
     *   @column address
     *   @dataType VARCHAR
     *   @length 250
     *   @scale 0
     *   @nullable false
     *   @jdbcType VARCHAR
     */
    private String address;

    /**
     *   @title 证明人及联系电话
     *   @remark 
     *   @column certifier
     *   @dataType VARCHAR
     *   @length 250
     *   @scale 0
     *   @nullable true
     *   @jdbcType VARCHAR
     */
    private String certifier;

    /**
     *   @title 开始时间
     *   @remark 
     *   @column start_time
     *   @dataType DATE
     *   @length 10
     *   @scale 0
     *   @nullable false
     *   @jdbcType DATE
     */
    private Date startTime;

    /**
     *   @title 结束时间
     *   @remark 
     *   @column end_time
     *   @dataType DATE
     *   @length 10
     *   @scale 0
     *   @nullable false
     *   @jdbcType DATE
     */
    private Date endTime;

    /**
     *   @title 任职概况
     *   @remark 
     *   @column job_content
     *   @dataType VARCHAR
     *   @length 500
     *   @scale 0
     *   @nullable true
     *   @jdbcType VARCHAR
     */
    private String jobContent;

    /**
     *   @title 附件
     *   @remark 
     *   @column append_files
     *   @dataType JSON
     *   @length 0
     *   @scale 0
     *   @nullable true
     *   @jdbcType CHAR
     */
    private String appendFiles;

    /**
     *   @title 申请人
     *   @remark 
     *   @column applicant_id
     *   @dataType BIGINT
     *   @length 19
     *   @scale 0
     *   @nullable false
     *   @jdbcType BIGINT
     */
    private Long applicantId;
    
    /**
     *   @title 所属部门
     *   @remark 
     *   @column dept_id
     *   @dataType BIGINT
     *   @length 19
     *   @scale 0
     *   @nullable false
     *   @jdbcType BIGINT
     */
    private Long deptId;
    
    /**
     *   @title 申请标题
     *   @remark 
     *   @column apply_name
     *   @dataType VARCHAR
     *   @length 250
     *   @scale 0
     *   @nullable true
     *   @jdbcType VARCHAR
     */
    private String applyName;

    /**
     *   @title 申请日期
     *   @remark 
     *   @column apply_time
     *   @dataType DATETIME
     *   @length 19
     *   @scale 0
     *   @nullable true
     *   @jdbcType TIMESTAMP
     */
    private Date applyTime;

    /**
     *   @title 审批人
     *   @remark 
     *   @column approve_id
     *   @dataType BIGINT
     *   @length 19
     *   @scale 0
     *   @nullable true
     *   @jdbcType BIGINT
     */
    private Long approveId;

    /**
     *   @title 审批日期
     *   @remark 
     *   @column approve_time
     *   @dataType DATETIME
     *   @length 19
     *   @scale 0
     *   @nullable true
     *   @jdbcType TIMESTAMP
     */
    private Date approveTime;

    /**
     *   @title 审批意见
     *   @remark 
     *   @column approve_comment
     *   @dataType VARCHAR
     *   @length 300
     *   @scale 0
     *   @nullable true
     *   @jdbcType VARCHAR
     */
    private String approveComment;

    /**
     *   @title 
     *   @remark 
     *   @column status
     *   @dataType INT
     *   @length 10
     *   @scale 0
     *   @nullable false
     *   @jdbcType INTEGER
     */
    private Integer status;

    /**
     *   @title 备注
     *   @remark 
     *   @column remark
     *   @dataType VARCHAR
     *   @length 300
     *   @scale 0
     *   @nullable true
     *   @jdbcType VARCHAR
     */
    private String remark;
    
    /**
     * 
     * @return 状态
     */
    public String getStatusName() {
    	return Level2ApplyStatusEnum.getText(status);
    }
    
    public String getTypeName() {
      return SysCacheUtil.getDirtionaryItemName("SOCIALJOBTYPE", type);
    }
    /**
     * 
     * @return 申请人
     */
    public String getApplicantName(){
    	return SysCacheUtil.getOperatorName(applicantId);
    }
    
    /**
     * 
     * @return 所属部门
     */
    public String getDeptName(){
    	return SysCacheUtil.getDepartmentName(deptId);
    }
    
    /**
     * 
     * @return 审批人
     */
    public String getApproveName(){
    	return SysCacheUtil.getOperatorName(approveId);
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getOrganizationt() {
        return organizationt;
    }

    public void setOrganizationt(String organizationt) {
        this.organizationt = organizationt;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getCertifier() {
        return certifier;
    }

    public void setCertifier(String certifier) {
        this.certifier = certifier;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getJobContent() {
        return jobContent;
    }

    public void setJobContent(String jobContent) {
        this.jobContent = jobContent;
    }

    public String getAppendFiles() {
        return appendFiles;
    }

    public void setAppendFiles(String appendFiles) {
        this.appendFiles = appendFiles;
    }

    public Long getApplicantId() {
        return applicantId;
    }

    public void setApplicantId(Long applicantId) {
        this.applicantId = applicantId;
    }

    public Date getApplyTime() {
        return applyTime;
    }

    public void setApplyTime(Date applyTime) {
        this.applyTime = applyTime;
    }

    public Long getApproveId() {
        return approveId;
    }

    public void setApproveId(Long approveId) {
        this.approveId = approveId;
    }

    public Date getApproveTime() {
        return approveTime;
    }

    public void setApproveTime(Date approveTime) {
        this.approveTime = approveTime;
    }

    public String getApproveComment() {
        return approveComment;
    }

    public void setApproveComment(String approveComment) {
        this.approveComment = approveComment;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Long getDeptId() {
		return deptId;
	}

	public void setDeptId(Long deptId) {
		this.deptId = deptId;
	}

	public String getApplyName() {
		return applyName;
	}

	public void setApplyName(String applyName) {
		this.applyName = applyName;
	}

	@Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SocialJob other = (SocialJob) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", type=").append(type);
        sb.append(", organizationt=").append(organizationt);
        sb.append(", address=").append(address);
        sb.append(", certifier=").append(certifier);
        sb.append(", startTime=").append(startTime);
        sb.append(", endTime=").append(endTime);
        sb.append(", jobContent=").append(jobContent);
        sb.append(", appendFiles=").append(appendFiles);
        sb.append(", applicantId=").append(applicantId);
        sb.append(", applyTime=").append(applyTime);
        sb.append(", approveId=").append(approveId);
        sb.append(", approveTime=").append(approveTime);
        sb.append(", approveComment=").append(approveComment);
        sb.append(", status=").append(status);
        sb.append(", remark=").append(remark);
        sb.append("]");
        return sb.toString();
    }
}